<template>
	<view>
		
		<view class="vi1">
			<view class="vi2">
				<view class="flex-row wrapper">
					<u-image class="im"
						:src="user.picture"
						width="112rpx" height="112rpx" shape="circle"></u-image>
					<view class="flex-col flex-row wraper-col vi3">
						<view class="u-line-1 text">{{user.name}}</view>
						<view class="u-line-1 text-two">产品部/产品经理</view>
					</view>
				</view>
			</view>
		</view>
		
		
		<view class="flex-col homepage">
			<u--form labelPosition="left" ref="form1">
				<view class="u-line-1 text">薪资明细</view>
				<u-form-item class="formItem" label="基本薪资" :label-width="200">
					<view class="flex-row wraper-row">
						<view class="u-line-1 text-two">￥{{money.basic}}</view>
					</view>
				</u-form-item>
				<u-form-item class="formItem-two" label="事假" :label-width="200">
					<view class="flex-row wraper-row-two">
						<view class="u-line-1 text-three">{{money.mleave}}天</view>
					</view>
				</u-form-item>
				<u-form-item class="formItem-three" label="事假扣款" :label-width="200">
					<view class="flex-row wraper-row-three">
						<view class="u-line-1 text-four">￥{{money.deduction}}</view>
					</view>
				</u-form-item>
				<u-form-item class="formItem-four" label="加班时间" :label-width="200">
					<view class="flex-row wraper-row-four">
						<view class="u-line-1 text-five">{{money.overtime}}时</view>
					</view>
				</u-form-item>
				<u-form-item class="formItem-five" label="加班工资" :label-width="200">
					<view class="flex-row wraper-row-five">
						<view class="u-line-1 text-six">￥{{money.overpay}}</view>
					</view>
				</u-form-item>
				<u-form-item class="formItem-six" label="个税" :label-width="200">
					<view class="flex-row wraper-row-six">
						<view class="u-line-1 text-seven">￥{{money.tax}}</view>
					</view>
				</u-form-item>
				<u-form-item class="formItem-seven" label="社保" :label-width="200">
					<view class="flex-row wraper-row-seven">
						<view class="u-line-1 text-eight">￥{{money.social}}</view>
					</view>
				</u-form-item>
				<u-form-item class="formItem-eight" label="实发工资" :label-width="200">
					<view class="flex-row wraper-row-eight">
						<view class="u-line-1 text-nine">￥{{money.social}}</view>
					</view>
				</u-form-item>
				</u--form>
				<view v-if="money.paytype == 2">
				<view class="flex-row wrapper">
					<!-- <uni-section title="一般用法" type="line" padding>
						<uni-countdown :day="1" :hour="1" :minute="12" :second="40" />
					</uni-section> -->
					<view class="u-line-1 text-ten">系统将于</view>
							<!-- <uni-countdown :show-day="false" :hour="24" :minute="12" :second="12" /> -->
					 
					<!-- <u-count-down class="countDown" :timestamp="86400" :font-size="16"></u-count-down> -->
					<view class="u-line-1 text-eleven">后自动确认</view>
				</view>
				<view class="daojishi">
					<uni-countdown :show-day="false" :hour="23" :minute="59" :second="59" />				
				</view>
				<u-button  class="button" type="success" @click="affirm()" shape="circle">
					确认工资
				</u-button>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		onLoad: function(option) {
			console.log("接收到的参数" + option.id);
			this.money.id = option.id

		},
		data() {
			return {
				money: {},
				user:{}
			}
		},
		created() {
			this.user=uni.getStorageSync('user')
			console.log(this.user)
			//获取用户头像
			uni.request({
				url: "http://localhost:8007/conference/social/getIdPic/"+this.user.eid,
				method: 'get',
				success: (res) => {
					console.log(res)
					this.user.picture = res.data.data.p.picture
					// console.log(this.dataList[0].paytime.)
				}
			})
			console.log("接收到的参数" + this.money.id);
			this.getsod()
		},
		methods: {
			getsod(){
				uni.request({
					url: "http://localhost:8007/conference/money/getIdMoney/" + this.money.id,
					method: 'get',
					success: (res) => {
						console.log(res)
						this.money = res.data.data.Money
				
						console.log(res.data.data.Money)
					}
				})
			},
		
			affirm(){
				
				this.money.paytype = 1
				this.money.paytime = null
				console.log(this.money)
				uni.request({
					url: "http://localhost:8007/conference/money/updateMoney",
					method: 'post',
					data:this.money,
					success: (res) => {
						console.log(res)
						this.getsod()
						// this.dataList = res.data.data.list
						// console.log(this.dataList[0].paytime)
						// console.log(this.dataList[0].paytime.)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	
	/*  头部开始	  */
		.flex-row {
			display: flex;
			align-items: flex-start;
		}
	
		.flex-col {
			display: flex;
			align-items: flex-start;
			flex-direction: column;
		}
	
		.text {
			width: 73px;
			margin-bottom: 14px;
			font-size: 20px;
		}
	
		.text-two {
			width: 100%;
			font-size: 12px;
		}
	
		.vi1 {
			width: 91%;
			height: 80px;
			background-color: white;
			margin: 10px 0px 0px 15px;
		}
	
		.vi2 {
			float: left;
			margin: 15px 0px 0px 20px;
		}
	
		.vi3 {
			margin: 0px 0px 0px 20px;
		}
	
		/* 头部结束	 */
	
	

	html,
	body {
		margin: 0;
		width: 100%;
		height: 100%;
		font-size: 16px
	}

	view,
	text,
	image {
		position: relative;
		box-sizing: border-box;
		flex-shrink: 0;
	}

	.flex-col {
		display: flex;
		align-items: flex-start;
		flex-direction: column;
	}

	.flex-row {
		display: flex;
		align-items: flex-start;
	}

	.flex-col .flex-row {
		width: 100%
	}

	/** 全局样式-结束*/

	.homepage {
		padding: 31px 0px 23px 22px;
		font-size: 3.5px;
		font-weight: 500;
	}

	.homepage .text {
		width: 100%;
		margin-bottom: 20px;
		font-size: 25px;
	}

	.homepage .formItem {
		width: 350px;
		margin: 0px 0px 6px 3px;
		color: #000000;
		flex: 0;
	}

	.homepage .formItem .wraper-row {
		width: 250px;
	}

	.homepage .formItem .text-two {
		width: 174px;
	}

	.homepage .formItem-two {
		width: 100%;
		margin-bottom: 1px;
		color: rgba(0, 0, 0, 1);
		flex: 0;
	}

	.homepage .formItem-two .wraper-row-two {
		width: 253px;
		height: 35px;
	}

	.homepage .formItem-two .text-three {
		width: 275px;
		top: 0px;
		left: 0px;
		position: absolute;
	}

	.homepage .formItem-three {
		width: 100%;
		color: rgba(0, 0, 0, 1);
		flex: 0;
	}

	.homepage .formItem-three .wraper-row-three {
		width: 253px;
		height: 35px;
	}

	.homepage .formItem-three .text-four {
		width: 275px;
		top: 0px;
		left: 0px;
		position: absolute;
	}

	.homepage .formItem-four {
		width: 100%;
		color: rgba(0, 0, 0, 1);
		flex: 0;
	}

	.homepage .formItem-four .wraper-row-four {
		width: 253px;
		height: 35px;
	}

	.homepage .formItem-four .text-five {
		width: 275px;
		top: 0px;
		left: 0px;
		position: absolute;
	}

	.homepage .formItem-five {
		width: 100%;
		color: rgba(0, 0, 0, 1);
		flex: 0;
	}

	.homepage .formItem-five .wraper-row-five {
		width: 253px;
		height: 35px;
	}

	.homepage .formItem-five .text-six {
		width: 275px;
		top: 0px;
		left: 0px;
		position: absolute;
	}

	.homepage .formItem-six {
		width: 100%;
		color: rgba(0, 0, 0, 1);
		flex: 0;
	}

	.homepage .formItem-six .wraper-row-six {
		width: 253px;
		height: 35px;
	}

	.homepage .formItem-six .text-seven {
		width: 275px;
		top: 0px;
		left: 0px;
		position: absolute;
	}

	.homepage .formItem-seven {
		width: 100%;
		color: rgba(0, 0, 0, 1);
		flex: 0;
	}

	.homepage .formItem-seven .wraper-row-seven {
		width: 253px;
		height: 35px;
	}

	.homepage .formItem-seven .text-eight {
		width: 275px;
		top: 0px;
		left: 0px;
		position: absolute;
	}

	.homepage .formItem-eight {
		width: 100%;
		margin-bottom: 6px;
		color: #fa3534;
		flex: 0;
	}

	.homepage .formItem-eight .wraper-row-eight {
		width: 253px;
		height: 35px;
	}

	.homepage .formItem-eight .text-nine {
		width: 275px;
		top: 0px;
		left: 0px;
		position: absolute;
		color: #ff9900;
	}

	.homepage .wrapper {
		width: 345px;
		margin: 0px 0px 64px 8px;
	}

	.homepage .wrapper .text-ten {
		width: 100%;
	}

	.homepage .wrapper .countDown {
		height: 16px;
		top: 0px;
		left: 49px;
		position: absolute;
		color: #fa3534;
	}

	.homepage .wrapper .text-eleven {
		width: 205px;
		top: 0px;
		right: 8px;
		position: absolute;
	}

	.homepage .button {
		width: 324px;
		margin-left: 8px;
		background: #2979ff;
	}
	.daojishi{
		width: 80px;
		height: 20px;
		font-size: 16px;
		float: left;
		margin: -86px 10px 10px 57px;
	}
</style>
